define([], () => {
  console.log('加载到了: ')
  // console.log(fp)

  const U = {

    //type Result result msg = Ok result | Err msg
    is_res_ok: res => res.Ok != null,
    result: res => res.Ok,
    error: res => res.Err,
    Ok: result => {
      return {Ok: (result==null) ? '' : result}
    },

    //type Maybe a = Just a | Nothing
    is_maybe_ok: maybe => maybe.just != null,
    Just: a => {return {just: a}},
    Nothing: () => {return {}},
    get_just: ({just = ''} = {}) => just,


    //type alias IO = {Realworld,Value}
    new_IO: (realworld,value) =>{return {realworld,value}},
    andthen: (io,f) => {return U.new_IO(io.realworld,f(io.value))},//相当于 >>=

    is_empty_string: str => str.length < 1,
    test: () => {console.log('Here is utils.js')},

    order_status: (order) => {
      switch(order.status){
        case 0: return '未接单'
        case 1: return '已接单'
        case 2: return '已完成订单'
        case 3: return '已退单'
        default: return '未知状态'
      }
    }
    
  }

  return U
})